package com.bum.api.processor.dev.html.bo;

import com.bum.api.core.exp.om.Metas;
import com.bum.api.core.exp.om.Params;
import com.bum.api.core.html.HtmlModel;
import com.bum.api.core.html.HtmlRender;

public class DevHtmlBO {
	HtmlRender	htmlRender;

	public String base64(String path, Params params, Metas metas) {
		HtmlModel model = HtmlModel.get(metas);
		return htmlRender.render("dev/dev-base64", model);
	}

	public String url(String path, Params params, Metas metas) {
		HtmlModel model = HtmlModel.get(metas);
		return htmlRender.render("dev/dev-url", model);
	}

	public String myip(String path, Params params, Metas metas) {
		HtmlModel model = HtmlModel.get(metas);
		String ip = metas.get(Metas.CLIENT_IP);
		model.put("ip", ip);
		return htmlRender.render("dev/dev-myip", model);
	}
	
	public String userAgentInfo(String path, Params params, Metas metas) {
		HtmlModel model = HtmlModel.get(metas);
		String agent = metas.get(Metas.USER_AGENT);
		model.put("agent", agent);
		return htmlRender.render("dev/dev-user-agent-info", model);
	}

	public void setHtmlRender(HtmlRender htmlRender) {
		this.htmlRender = htmlRender;
	}
}
